#! /usr/bin/python

import sys

#print sys.modules
print sys.modules["os"]
print sys.platform
print sys.path

import os
print os.environ
print os.curdir
print "group id:",os.getgid(),", user id:", os.getuid()
print "groups:", os.getgroups()
print "log name:", os.getlogin()

#sys.stdout.write(">>> ");
#cmd = sys.stdin.readline()
#while cmd:
#    os.system(cmd)
#    sys.stdout.write(">>> ");
#    cmd = sys.stdin.readline()

print os.mkdir("./tmp", 0744)
print os.system("echo 'hello' > ./tmp/a.txt")
print os.listdir('./tmp')
print os.rename('./tmp/a.txt', './tmp/b.txt')
print os.system("cat ./tmp/b.txt")
print os.listdir("./tmp")
print os.remove('./tmp/b.txt')
print os.listdir("./tmp")
print os.rmdir('./tmp')
print os.listdir(".")

print os.getcwd()
print os.path.split(os.getcwd())
print os.path.join(os.getcwd(), "a", "a.doc")
print os.path.exists(os.getcwd())
print os.path.expanduser("~/workspace/project")
print os.path.expandvars("$PATH")
